<?php

Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$.fn.yiiGridView.update('coupon-grid', {
		data: $(this).serialize()
	});
	return false;
});
");
?>

<?php
$this->pageTitle=Yii::app()->name . ' - 优惠券管理';
?>
<div id="partner">
	<div class="dashboard" id="dashboard">
		<ul>
		<li><a href="<?php echo $this->createUrl('index'); ?>">优惠券列表</a><span></span></li>
		<li class="current"><a href="<?php echo $this->createUrl('admin'); ?>">优惠券管理</a><span></span></li>
		</ul>
	</div>
	<div id="content" class="clear mainwide">
        <div class="clear box">
            <div class="box-top"></div>
            <div class="box-content">
                <div class="head"><h2>优惠券管理</h2></div>
                <div class="sect">


<?php echo CHtml::link('高级查找','#',array('class'=>'search-button')); ?>
<div class="search-form" style="display:none">
<?php $this->renderPartial('_search',array(
	'model'=>$model,
)); ?>
</div><!-- search-form -->

<?php
 $this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'coupon-grid',
	'dataProvider'=>$model->search(),
	'filter'=>$model,
	'columns'=>array(
		'id',
		'secret',
		'user_id',
		'partner_id',
		'team_id',
		'consume',
		'expire_time:datetime',
		/*
		'order_id',

		'consume_time',
		'create_time',
		*/
		array(
			'class'=>'CButtonColumn',
		),
	),
)); ?>
				</div>
            </div>
            <div class="box-bottom"></div>
        </div>
	</div>
</div>